package com.hexun.busi.base;

import com.hexun.busi.base.common.config.Config;
import com.hexun.busi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;


/**
 * @auther: zhoudong
 * @date: 2018/4/23 14:05
 */
@SpringBootApplication
@ComponentScan(basePackages = "com.hexun.busi")
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
@EnableConfigurationProperties({Config.class})
@ServletComponentScan
@EnableFeignClients(basePackages = "com.hexun.busi.client")
public class BaseApplication  extends SpringBootServletInitializer {
	private static final Logger logger = LoggerFactory.getLogger(BaseApplication.class);
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(BaseApplication.class);
	}
	public static void main(String[] args) {
		SpringApplication.run(BaseApplication.class, args);

		logger.info(" ** ShareApplication start:{}", DateUtils.getSysDateTimeString());
	}

}
